import request from '@/utils/request'

export const login = data => request.post('/app/v1_0/authorizations', data)

export const sendCode = data => request.get('/app/v1_0/sms/codes/' + data)

export const getUserInfo = data => request.get('/app/v1_0/user')

export const getUserChannels = data => request.get('/app/v1_0/user/channels')

/**
 * 添加关注
 */
export const addFollow = data => request.post('/app/v1_0/user/followings', { target: data })

/**
 * 取消关注
 */
export const deleteFollow = data => request.delete(`/app/v1_0/user/followings/${data}`)

// 收藏文章

export const addKeepFollow = data => request.post('/app/v1_0/article/collections', { target: data })

// 取消收藏

export const deleteKeepFollow = data => request.delete(`/app/v1_0/article/collections/${data}`)

// 评论点赞

export const addLikeComment = data => request.post('/app/v1_0/comment/likings', { target: data })

// 取消评论点赞

export const unLikeCommnet = data => request.delete(`/app/v1_0/comment/likings/${data}`)

// 发布评论

export const postComment = data => request.post('/app/v1_0/comments', data)

// 获取用户个人资料

export const getUserData = data => request.get('/app/v1_0/user/profile')

// 更改资料

export const updataUserData = data => request.patch('/app/v1_0/user/profile', data)

// 跟新头像

export const updataUserPhoto = data => request.patch('/app/v1_0/user/photo', data)

// import { requisition } from '@/utils/request'

// export const login = data => requisition.post('/v1_0/authorizations', data)

// export const sendCode = data => requisition.get('/v1_0/sms/codes/' + data)

// export const getUserInfo = data => requisition.get('/v1_0/user')

// export const getUserChannels = data => requisition.get('/v1_0/user/channels')

// export const addFollow = data => requisition.post('/v1_0/user/followings', { target: data })

// export const deleteFollow = data => requisition.delete(`/v1_0/user/followings/${data}`)
